"use strict";
var amapFile = require('../libs/amap-wx.js');
var config = require('../libs/config.js');
var key = config.Config.key;
var myAmapFun = new amapFile.AMapWX({key: key});

function getRidingRoute(origin, destination) {
	return new Promise(function (resolve, reject) {
		myAmapFun.getRidingRoute({
			origin: origin,
			destination: destination,
			success: function(data){
				resolve(data)
			},
			fail: function (err) {
				reject(err)
			}
		});
	});
}

module.exports = {
	getRidingRoute: getRidingRoute
};